import { defineStore } from "pinia";
import { ref } from "vue";
import { RouteLocationNormalizedLoaded, useRoute } from "vue-router";
let $route = useRoute();

export const tabsStore = defineStore({
  id: "tab",
  state: () => ({
    oTabsList: [] as RouteLocationNormalizedLoaded[]
  }),
  actions: {
    add_tabs(activeName: any) {
      let isAdd = this.oTabsList.some(item => item.name == activeName)
      if (!isAdd) {
        this.oTabsList.push($route);
      }
    }
  }

})